/*@@

    Copyright (c) 2010 BlueSky LTD.  All rights reserved. 

    Created_datetime : 23:6:2010 17:14:18

    File Name :	winmutex.h

    Author : Wang Hu (ghoststears@gmail.com)

    Description : 

@@*/

#ifndef __WINMUTEX_H__
#define __WINMUTEX_H__


#ifdef _WIN32
#include <Windows.h>
#else
#include <pthread.h>
#endif


namespace BLK
{
    class Mutex
    {
    public:
        Mutex();
        ~Mutex();

    public:
        bool    Lock();
        bool    Unlock();

    private:
#ifdef _WIN32
        HANDLE m_mutex;
#else
        mutable pthread_mutex_t m_mutex;
#endif
    };
};

#endif /* __WINMUTEX_H__ */
